package com.funo.business.entities;
// default package

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import com.funo.main.entities.User;


/**
 * Company entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="T_COMPANY"
    ,schema="UNIBASE"
)
@DynamicInsert
@DynamicUpdate
public class Company  implements java.io.Serializable {


    // Fields    

     /**
	 * 公司介绍
	 */
	private static final long serialVersionUID = 5807142441231908470L;
	
	 private String companyId;
     private String companyName;
     private String companyInfo;
     private String companyLogo;
     private String companyPic;
     private String companyAddress;
     private int isValid;
     private Date insertDt;
     
     private User user;
     private TemplateItem templateItem;

    // Constructors

    /** default constructor */
    public Company() {
    }

	/** minimal constructor */
    public Company(int isValid) {
        this.isValid = isValid;
    }
    
    /** full constructor */
    public Company(String companyName, String companyInfo, String companyLogo, String companyPic, Date insertDt, String companyAddress, int isValid) {
        this.companyName = companyName;
        this.companyInfo = companyInfo;
        this.companyLogo = companyLogo;
        this.companyPic = companyPic;
        this.companyAddress = companyAddress;
        this.isValid = isValid;
    }

   
    @Id
    @Column(name="COMPANY_ID", unique=true, nullable=false, length=40)

    public String getCompanyId() {
        return this.companyId;
    }
    
    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }
    
    @Column(name="COMPANY_NAME", length=40)

    public String getCompanyName() {
        return this.companyName;
    }
    
    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }
    
    @Column(name="COMPANY_INFO", length=1000)

    public String getCompanyInfo() {
        return this.companyInfo;
    }
    
    public void setCompanyInfo(String companyInfo) {
        this.companyInfo = companyInfo;
    }
    
    @Column(name="COMPANY_LOGO", length=100)

    public String getCompanyLogo() {
        return this.companyLogo;
    }
    
    public void setCompanyLogo(String companyLogo) {
        this.companyLogo = companyLogo;
    }
    
    @Column(name="COMPANY_PIC", length=100)

    public String getCompanyPic() {
        return this.companyPic;
    }
    
    public void setCompanyPic(String companyPic) {
        this.companyPic = companyPic;
    }
    
    @ManyToOne
	@JoinColumn(name = "TEMPLATE_ID")
	public TemplateItem getTemplateItem() {
		return templateItem;
	}

	public void setTemplateItem(TemplateItem templateItem) {
		this.templateItem = templateItem;
	}

    
    @ManyToOne
	@JoinColumn(name = "USER_ID")
    public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
    
    @Column(name="COMPANY_ADDRESS", length=100)

    public String getCompanyAddress() {
        return this.companyAddress;
    }

	public void setCompanyAddress(String companyAddress) {
        this.companyAddress = companyAddress;
    }
    
    @Column(name="IS_VALID", nullable=false, precision=1, scale=0,insertable=false)

    public int getIsValid() {
        return this.isValid;
    }
    
    public void setIsValid(int isValid) {
        this.isValid = isValid;
    }
    
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="INSERT_DT", length=7,insertable=false,updatable=false)

    public Date getInsertDt() {
        return this.insertDt;
    }
    
    public void setInsertDt(Date insertDt) {
        this.insertDt = insertDt;
    }

	@Override
	public String toString() {
		return "Company [companyAddress=" + companyAddress + ", companyId="
				+ companyId + ", companyInfo=" + companyInfo + ", companyLogo="
				+ companyLogo + ", companyName=" + companyName
				+ ", companyPic=" + companyPic + ", insertDt=" + insertDt
				+ ", isValid=" + isValid + ", user=" + user + "]";
	}
   
}